/**
 *
 */
package demo.tellurium.module

import groovy.lang.MetaClass;


import demo.tellurium.framework.BaseUIModule;

/**
 * @author roger.xu
 *
 */
class TableModule extends BaseUIModule {

    @Override
    public void defineUi() {
        ui.Container(uid: "TableExample") {
            Table(uid: "Table", clocator: [tag: "table", id: "table_demo"]) {
                //define table elements
                //for the first row
                TextBox(uid: "{row: 1, column: all}", clocator: [:])
                //For the rest, just UrlLink
                UrlLink(uid: "{row: all, column: all}", clocator: [:])
            }
        }
    }

    public static final String URL_KEY = "demo.table.url";

    /* ---- Ul ---------------*/
    public void doClickCell(int row, int column) {
        def uid = String.format("TableExample.Table[%d][%d]", row, column);
        String text = getText(uid);
        console.debug("[" +row + "," + column + "]", text);
    }

}
